#! -*- python -*-
#
# Copyright (c) 2011 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import make_nacl_env
import os

#src_dir = os.path.abspath("c")
src_dir = "c"

nacl_env = make_nacl_env.NaClEnvironment(nacl_platform=os.getenv('NACL_TARGET_PLATFORM'))

nacl_env.Append(CCFLAGS=['-Werror'])
nacl_env.Append(CPPPATH=[os.getenv('NACL_SDK_USR_INCLUDE')])
nacl_env.Append(CPPPATH=[os.path.join(src_dir,'custom/include')])
nacl_env.Append(LIBPATH=[os.getenv('NACL_SDK_USR_LIB')])
nacl_env.Append(LIBS=['pthread','srpc','ssh2','z','nosys','crypto','pthread','srpc','ssh2','z','nosys','crypto'])

sources = [os.path.join(src_dir,'nacl.c'), \
           os.path.join(src_dir,'custom/ioctl.c'), \
           os.path.join(src_dir,'custom/in.c'), \
           os.path.join(src_dir,'custom/socket.c'), \
           os.path.join(src_dir,'custom/poll.c'), \
           os.path.join(src_dir,'custom/termios.c'), \
           os.path.join(src_dir,'custom/netdb.c') ]


nacl_env.AllNaClModules(sources, 'chrome-ssh')
